home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
ifp1s158.zip
/
PAGE_06.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-26
|
40KB
|
1,221 lines
unit page_06;
interface
uses crt, dos, graph, ifpglobl, ifpcomon, ifpextrn;
procedure page06;
implementation
procedure page06;
const
atividmons: array[0..15] of string[24] =
('EGA', 'analog monochrome', 'TTL monochrome', 'analog color',
'RGB color', 'Multisync or compatible', '(unknown)',
'PS/2 8514 or compatible', 'Seiko 1430', 'MultiSync 2A',
'Tatung OmniScan', 'NEC 3D or compatible', 'TVM 3M',
'NEC MultiSync XL/+/4D/5D', 'TVM 2A', 'TVM 3A');
trividmons: array[0..7] of string[17] =
('MDA', 'CGA', 'EGA', 'Digital multisync', 'VGA', '8514',
'SuperVGA', 'Analog multisync');
parachips: array[1..4] of string[7] =
('PVGA1A', 'WD90C00', 'WD90C10', 'WD90C11');
type
cardtype = (none, vesa, standard, paradise, video7, ati, ahead, cirrus,
cti, genoa, trident, tseng, zymos);
VESAitype = record
signature: array[0..3] of char;
version: word;
OEMnameOfs: word;
OEMnameSeg: word;
capabilities: array[0..3] of byte;
modesOfs: word;
modesSeg: word;
reserved: array[0..237] of byte;
end;
VESAmtype = record
modeattr: word;
winaattr: byte; {Window A attributes}
winbattr: byte; {Window B attributes}
wingran: word; {Window Granularity}
winsize: word; {Window Size}
winaseg: word; {Window A segment}
winbseg: word; {Window B segment}
posOfs: word; {Offset of Far call to positioning function}
posSeg: word; {Segment ..}
scansize: word; {Bytes per scan line}
{The following information is optional for VESA modes,
required for OEM modes}
pixwidth: word;
pixheight: word;
charwidth: byte;
charheight: byte;
memplanes: byte;
pixelbits: byte;
banks: byte;
memmodel: byte;
banksize: byte;
imagepages: byte;
reserved0a: byte;
{The following is part of VESA 1.2 and newer}
RedMaskSize: byte;
RedFieldPos: byte;
GrnMaskSize: byte;
GrnFieldPos: byte;
BluMaskSize: byte;
BluFieldPos: byte;
RsrvdMaskSize: byte;
RsrvdMaskPos: byte;
DirectColorInfo: byte;
Reserved0b: byte;
reserved: array[0..215] of byte;
end;
ATIvidtype = record
columns: byte;
maxrow: byte;
lines_a_row: byte;
buffer_size: word;
seqreg: array[1..4] of byte;
miscreg: byte;
crtsreg: array[0..$18] of byte;
attrreg: array[0..$13] of byte;
graphreg: array[0..8] of byte;
end;
var
i : byte;
VGAbuf : array[$00..$10] of byte;
VESAinfo: VESAitype;
VESAmode: VESAmtype;
xbyte, xbyte2, xbyte3, paralock1, paralock2: byte;
xword1 : word;
xword2 : word;
xword3 : word;
xword4 : word;
vgacard: cardtype;
vidmem : word;
s: string;
c: char;
saveattr, savex, savey: byte;
foundone, foundit: boolean;
procedure captfont;
begin
caption1('Font Address');
Writeln;
Write('INT 1FH ');
segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
Writeln
end; {captfont}
procedure showfont(a : byte);
const
fontnames: array [0..7] of string[12] = (
'INT 1FH ',
'INT 43H ',
'ROM 8x14 ',
'ROM 8x8 (lo)',
'ROM 8x8 (hi)',
'ROM 9x14 ',
'ROM 8x16 ',
'ROM 9x16 ');
begin
with regs do
begin
Write(fontnames[a], ' ');
AX:=$1130;
BH:=a;
intr($10, regs);
segofs(ES, BP);
Writeln
end
end; {showfont}
procedure int101210;
const
memnames: array[0..3] of string[4] = ('64K', '128K', '192K', '256K');
begin
with regs do
begin
AH:=$12;
BL:=$10;
intr($10, regs);
caption2('Display type');
case BH of
$00 : Writeln('color');
$01 : Writeln('monochrome')
else
unknown('display', BH, 2)
end;
caption2('Memory');
if vidmem > 0 then
Writeln(vidmem, 'K')
else
if BL < 4 then
Writeln(memnames[BL], ' as determined from standard BIOS call')
else
unknown('size', BL, 2);
if vgacard = none then
begin
caption2('Feature bits');
Writeln(bin4(CH and $0F));
caption2('DIP switches (EGA)');
Writeln(bin4(CL and $0F))
end
end
end;
function readROM(seg, ofs: word; length: byte): string;
var
x: word;
s: string;
begin
s:='';
for x:=ofs to ofs + (length - 1) do
s:=s + Chr(Mem[seg:x]);
readROM:=s
end; {readROM}
procedure checking(s: string);
var
x, y: byte;
begin
x:=WhereX;
y:=WhereY;
ClrEol;
Write('Checking for ', s);
GotoXY(x, y);
end; {checking}
procedure d8or16bit(b: boolean);
begin
if b then
Write('8-bit')
else
Write('16-bit');
end;
procedure cli;
inline($FA);
procedure sti;
inline($FB);
function isXGA: word;
var
POSport, cardID, tmpw: word;
tmp, tmp1, tmp2, tmp3, tmp4: byte;
slot: byte;
regs: registers;
foundit: boolean;
begin
isXGA:=0;
foundit:=false;
with regs do
begin
DX:=$FFFF;
AX:=$C400;
Intr($15, regs);
if (not nocarry(regs)) or (DX = -1) then
Exit;
posport:=DX;
slot:=0;
repeat
cli;
if slot = 0 then
Port[$94]:=$DF
else
begin
AX:=$C401;
BX:=slot;
Intr($15, regs)
end;
cardID:=PortW[POSport];
tmp1:=Port[POSport + 2];
tmp2:=Port[POSport + 3];
tmp3:=Port[POSport + 4];
tmp4:=Port[POSport + 5];
if slot = 0 then
Port[$94]:=$FF
else
begin
AX:=$C402;
BX:=slot;
Intr($15, regs);
end;
cli;
if (cardID >= $8FD8) and (cardID <= $8FDB) then
begin
tmpw:=tmp1 and $E;
POSport:=(tmpw shl 3) + $2100;
Port[POSport + $A]:=$52;
tmp:=Port[POSport + $B] and $F;
if (tmp <> 0) and (tmp <> $F) then
foundit:=true
else
Inc(slot);
end
else
Inc(slot);
until foundit or (slot > 9);
end;
if foundit then
isXGA:=POSport;
end; {isXGA}
procedure isport2(var regs: registers; var foundit: boolean);
var
savebx, saveax: word;
tmp: byte;
begin
with regs do
begin
savebx:=BX;
BX:=AX;
Port[DX]:=AL;
AH:=AL;
AL:=Port[DX + 1];
tmp:=AH;
AH:=AL;
AL:=tmp;
saveax:=AX;
AX:=BX;
PortW[DX]:=AX;
Port[DX]:=AL;
AH:=AL;
AL:=Port[DX + 1];
AL:=AL and BH;
foundit:=(AL = BH);
if AL = BH then
begin
AL:=AH;
AH:=0;
Port[DX]:=AX;
Port[DX]:=AL;
AH:=AL;
AL:=Port[DX + 1];
AL:=AL and BH;
foundit:=(AL = 0);
end;
AX:=saveax;
PortW[DX]:=AX;
BX:=savebx;
end;
end;
begin (* procedure page_06 *)
vgacard:=none;
caption2('Display adapter');
checking('VESA');
with regs do
begin